package com.guomao.entity;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

//@Data
//@AllArgsConstructor
//@NoArgsConstructor
public class Person {
    private String name;
    private int age;

    private Car c;

    public Car getC() {
        return c;
    }

    public void setC(Car c) {
        this.c = c;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        System.out.println("setName: " + name);
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        System.out.println("setAge: " + age);
        this.age = age;
    }

    public Person() {
        System.out.println("Person no args constructor");
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("Person hava args constructor");
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", c=" + c +
                '}';
    }
}

